package com.ygqh.baby.ao;

import org.apache.commons.lang.StringUtils;

/**
 * @author: sunshuo
 * @date: 2018/12/11 17:30
 */
public enum WholeSaleRecordType {

	/**
	 * 订单
	 */
	Order(1, "订单"),

	/**
	 * 退单
	 */
	ReturnOrder(2, "退单"),

	/**
	 * 运费
	 */
	Postage(3, "运费"),

	/**
	 * 其它
	 */
	Other(0, "其它");

	private int code;

	private String desc;

	WholeSaleRecordType(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

	public String getDesc(String name) {
		return StringUtils.isNotBlank(name) ? WholeSaleRecordType.valueOf(name).getDesc() : null;
	}
}
